#pragma once
#include <iostream>


//实现类接口Color（颜色类)
class Color{
public:
	virtual void bepaint(std::string penType,std::string name) = 0;
}; 


class Red : public Color{
public:
	void bepaint(std::string penType,std::string name){
		std::cout << penType + "红色的" + name + "." << std::endl;
	}
};


class Green : public Color{
public:
	void bepaint(std::string penType,std::string name){
		std::cout << penType + "绿色的" + name + "." << std::endl;
	}
};


class Pen{
public:
	virtual void draw(std::string name) = 0;
	void setColor(Color* color){
		this->color = color;
	}
protected:
	Color* color;
}; 

class BigPen : public Pen{
public:
	void draw(std::string name){
		std::string penType = "大号毛笔绘制";
		this->color->bepaint(penType,name);
	}
};


class SmallPen : public Pen{
public:
	void draw(std::string name){
		std::string penType = "小号毛笔绘制";
		this->color->bepaint(penType,name);
	}
};